package com.shd.edanpei.ui.adapter;

import android.content.Context;

import com.chad.library.adapter.base.BaseViewHolder;
import com.shd.edanpei.R;
import com.shd.edanpei.base.BaseQuickImageAdapter;
import com.shd.edanpei.common.Constant;
import com.shd.edanpei.bean.ScoreModel;
import com.shd.edanpei.ui.activity.AccountActivity;

public class AccountAdapter extends BaseQuickImageAdapter<ScoreModel> {

    private String mType;

    public AccountAdapter(Context context, String type) {
        super(context, R.layout.item_score);
        this.mType = type;
    }

    @Override
    protected void convert(BaseViewHolder helper, ScoreModel item) {

        helper.setText(R.id.tv_score_title, item.getDescription())
                .setText(R.id.tv_score_time, item.getCreateTime())
                .setText(R.id.tv_score_count, (mType.equals(AccountActivity.IN) ? "+" + item.getAmount() : item.getAmount()) + "积分");
    }

    public void setType(String type) {
        this.mType = type;
    }
}
